package com.yang.command;

import com.yang.YangGUI;
import com.zhaoyang.utils.YangGuiUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class GuiOpenCommand implements CommandExecutor {

    private static YangGUI yangGUI;

    public void GuiOpen(YangGUI yangGUI) {
        this.yangGUI = yangGUI;
    }

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (cmd.getName().equalsIgnoreCase("yangGui") && sender instanceof Player) {
            Player player = (Player) sender;
            YangGuiUtils.openMainMenu(player);
            return true;
        }
        return false;
    }
}
